<template>
<!--新闻内页-->
<div id="news">
    <div class="bread_rumb clearfix newtab">
        <div class="f_l">
            <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/companyOutline' }">{{ $lang('COMPANY_INTRODUCE') }}</el-breadcrumb-item>
            <el-breadcrumb-item>{{ $lang('News_detail') }}</el-breadcrumb-item> 
            </el-breadcrumb>
        </div>
    </div>
	<div class="container">
		<div class="title">
			<span>{{$i18n.locale == 'zh'?newData.zhTitle || $lang('No_data'):newData.enTitle || $lang('No_data')}}</span><span>{{newData.createDate}}</span>
		</div>
		<div class="cont" v-html="$i18n.locale == 'zh'?newData.zhContent || $lang('No_data'):newData.enContent || $lang('No_data')"></div>
        <span @click="getInformationdetail(newData.nextInfoId)">{{ $lang('LAST_ARTICLE') }}</span>
        <span @click="getInformationdetail(newData.preInfoId)">{{ $lang('NEXT_ARTICLE') }}</span>
	</div>
</div>
</template>

<script>
import { gets } from "@/api/api.js";
export default {
	data(){
		return {
            newData: []
		}
    },
	methods:{
        async getInformationdetail(id) {
            let that = this
            if(id === null) {
                that.$message({
                    message: that.$lang('No_more'),
                    type: 'warning'
                }); 
                return false
            } else {
                try {
                    let res = await gets.searchCompanyList("/information/find-detail.json", {
                        id: id,
                    });
                    // console.log(res)
                    that.newData = res.data
                } catch (e) {
                    console.log(e)
                    throw e;
                }
            }
        },
	},
	mounted(){
		this.getInformationdetail(this.$route.query.id)
	}
}
</script>

<style lang="scss">
@import '~assets/scss/news.scss';
.newtab{
    width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 20px 0;
    .f_l{
        span{
            color: #fff !important;
        }
    }
}
</style>